#ifndef TALKWIDGET_H
#define TALKWIDGET_H

#include <QWidget>
#include <QSplitter>
#include <QTextEdit>
#include <QLineEdit>
#include <QToolButton>
#include <QHBoxLayout>

class TalkWidget : public QSplitter
{
    Q_OBJECT
    QString mClientID;
    QTextEdit mTalkEdit;
    QLineEdit mSendEdit;
    QToolButton mSendBtn;
public:
    explicit TalkWidget(QWidget *parent = 0);

    void display(QString clientID, QString msg, Qt::Alignment align);
    void showSysMsg(QString msg);
    void clearEdit();
    void clearTalk();
signals:
    void sendTalk(QString msg);
protected slots:
    void onSendClicked();
    void onSendMenuClicked();
protected:
    bool eventFilter(QObject* obj, QEvent* evt);
};

#endif // TALKWIDGET_H
